<template>
    <el-table-column :prop="data.field" :label="data.label" :sortable="data.sortable" :width="data.labelWidth">
        <template slot="header">
            <head-tips :value="data.headTips" :data="data" />
        </template>
        <template slot-scope="scope">
            <table-content :data="data" :value="value" :scope="scope"></table-content>
        </template>
    </el-table-column>
</template>
<script type="text/javascript">
import HeadTips from './Drives/HeadTips';
import TableContent from './TableContent.vue';

export default {
    name: "tableitem",
    props: {
        value: [Array, Object],
        data: [Array, Object]
    },
    inject: ['model'],
    components: {
        'head-tips': HeadTips,
        'table-content': TableContent,
    },
    data() {
        return {
            arr: null,
        }
    },
    /**
     * 计算属性
     * @type {Object}
     */
    computed: {

    },
    /**
     * 数据监听
     * @type {Object}
     */
    watch: {

    },
    /**
     * 页面加载执行
     * @return {[type]} [description]
     */
    mounted() {},
    /**
     * 页面方法
     * @type {Object}
     */
    methods: {
        handleAction(index, data, action) {
            console.log("操作数据", [index, data, action])
        },

        /**
         * 表头筛选
         * @param  {[type]} value  [description]
         * @param  {[type]} row    [description]
         * @param  {[type]} column [description]
         * @return {[type]}        [description]
         */
        filterHandler(value, row, column) {
            const property = column['property'];
            return row[property] === value;
        }

    }
}
</script>
<style type="text/css" lang="scss">
.__table_img {
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-size: 100% auto;
    width: 100px;
    height: 100px
}
</style>